From: Andrew Cooper Date: Tue, 6 Aug 2013 13:48:36 +0000 (+0100) Subject: rombios/keyboard: Don't needlessly poll the status register X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~6556 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:///%22http:/www.example.com/cgi/%22https:/?a=commitdiff_plain;h=20025504271220ab3bf041955a3cd40c6057e58e;p=xen.git rombios/keyboard: Don't needlessly poll the status register Repeated polling of the status register is not going to change its value, so don't needlessly take 8192 traps to Qemu when 1 will do. Signed-off-by: Andrew Cooper Acked-by: Keir Fraser --- diff --git a/tools/firmware/rombios/rombios.c b/tools/firmware/rombios/rombios.c index 80980b67f8..e364759b3b 100644 --- a/tools/firmware/rombios/rombios.c +++ b/tools/firmware/rombios/rombios.c @@ -1805,12 +1805,12 @@ keyboard_init() while ( (inb(0x64) & 0x02) && (--max>0)) outb(0x80, 0x00); /* flush incoming keys */ - max=0x2000; + max=2; while (--max > 0) { outb(0x80, 0x00); if (inb(0x64) & 0x01) { inb(0x60); - max = 0x2000; + max = 2; } }